class MilitarnaturesController < ApplicationController
  # GET /militarnatures
  # GET /militarnatures.xml
  def index
    @militarnatures = Militarnature.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @militarnatures }
    end
  end

  # GET /militarnatures/1
  # GET /militarnatures/1.xml
  def show
    @militarnature = Militarnature.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @militarnature }
    end
  end

  # GET /militarnatures/new
  # GET /militarnatures/new.xml
  def new
    @militarnature = Militarnature.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @militarnature }
    end
  end

  # GET /militarnatures/1/edit
  def edit
    @militarnature = Militarnature.find(params[:id])
  end

  # POST /militarnatures
  # POST /militarnatures.xml
  def create
    @militarnature = Militarnature.new(params[:militarnature])
    
    respond_to do |format|
      if @militarnature.save
        flash[:notice] = 'Militarnature was successfully created.'
        format.html { redirect_to(militarnatures_url) }
        format.xml  { render :xml => @militarnature, :status => :created, :location => @militarnature }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @militarnature.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /militarnatures/1
  # PUT /militarnatures/1.xml
  def update
    @militarnature = Militarnature.find(params[:id])

    respond_to do |format|
      if @militarnature.update_attributes(params[:militarnature])
        flash[:notice] = 'Militarnature was successfully updated.'
        format.html { redirect_to(militarnatures_url) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @militarnature.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /militarnatures/1
  # DELETE /militarnatures/1.xml
  def destroy
    @militarnature = Militarnature.find(params[:id])
    @militarnature.destroy

    respond_to do |format|
      format.html { redirect_to(militarnatures_url) }
      format.xml  { head :ok }
    end
  end
end
